﻿namespace CliCpp.Donet.Models;

public struct LogTransInfo
{
    public readonly string TransInfo;

    public readonly int DeepLength;

    public LogTransInfo()
    {
        TransInfo = $"FK{Guid.NewGuid().ToString().Substring(0, 4)}";
        DeepLength = 0;
    }

    public LogTransInfo(string token)
    {
        TransInfo = token;
        DeepLength = 0;
    }

    public LogTransInfo(LogTransInfo logTransInfo)
    {
        DeepLength = logTransInfo.DeepLength + 1;
        TransInfo = $"{logTransInfo.TransInfo}-{DeepLength}";
    }
}